new Vue({
	el: '#app',
	data: {
		id: '',
		uid: '',
		user: '',
		path: '',
		msgDetails: ''
	},
	mounted: function() {
		this.init();
	},
	methods: {
		init: function() {
			this.uid = $api.getStorage('uid');
			if(this.uid) {
				this.getUserMsg();
			} else {
				api.toast({
					msg: "no uid",
					duration: 2000,
					location: 'middle'
				});
			}
		},
		getUserMsg: function() {
			var self = this;
			apiready = function() {
				var fid = api.pageParam;
				self.id = fid.id;
				self.myMsgDetails();
			};
		},
		//消息详情
		myMsgDetails: function() {
			var self = this;
			console.log(self.id);
			var data = {
				id: self.id
			};
			$.post(base + config.msg_show, data, function(msg) {
				console.log(msg);
				if(msg.error == 0) {
					self.msgDetails = msg.data;
					self.path = msg.path;
				} else {
					console.log(msg.error_msg);
					api.toast({
						msg: msg.error_msg,
						duration: 2000,
						location: 'middle'
					});
				}
			}, 'json');
		}
	}
})